#ifndef _YL_LOG_MESSAGE_
#define _YL_LOG_MESSAGE_

using namespace System::Runtime::Serialization;

namespace yoctolog_viewer
{
	ref class LogMessageTemplate;

	[System::SerializableAttribute]
	public ref class LogMessage: public ISerializable
	{
	public:
		property unsigned int						m_uiID;
		LogMessageTemplate ^						m_pTemplate;
		System::Collections::ArrayList ^			m_vecParameters;
		System::Collections::Generic::List<int> ^	m_vecCallstack;

		LogMessage()
		{
			m_vecCallstack = gcnew System::Collections::Generic::List<int>();
			m_vecParameters = gcnew System::Collections::ArrayList();
		}

		~LogMessage()
		{
			delete m_vecParameters;
			delete m_vecCallstack;
		}

		// Serialization
		virtual void GetObjectData(System::Runtime::Serialization::SerializationInfo ^info, System::Runtime::Serialization::StreamingContext context)
		{
			info->AddValue("m_pTemplate", m_pTemplate);
			info->AddValue("m_vecCallstack", m_vecCallstack);
			info->AddValue("m_vecParameters", m_vecParameters);
		}

		LogMessage(System::Runtime::Serialization::SerializationInfo ^info, System::Runtime::Serialization::StreamingContext context)
		{
			m_pTemplate = (LogMessageTemplate^)info->GetValue("m_pTemplate", LogMessageTemplate::typeid);
			m_vecCallstack = (System::Collections::Generic::List<int> ^)info->GetValue("m_vecCallstack", System::Collections::Generic::List<int>::typeid);
			m_vecParameters = (System::Collections::ArrayList ^)info->GetValue("m_vecParameters", System::Collections::ArrayList::typeid);
		}

	};
}

#endif